package org.samcolon.eeexplore.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.samcolon.eeexplore.service.MergeService;
import org.samcolon.eeexplore.service.SysMenuService;
import org.samcolon.eeexplore.utils.EasyExcel2Util;
import org.samcolon.eeexplore.vo.DetailRecordVO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

/**
 * @Description: 合并表头请求
 * @author: Sam.zhang
 * @date: 2021.07.21
 */
@Slf4j
@AllArgsConstructor
@RequestMapping("merge")
@RestController
@Api(tags = "相关测试")
public class MergeController {
    @Resource
    SysMenuService sysMenuService;

    @PostMapping("record/download")
    @ApiOperation(value = "记录流水查询")
    public void downloadDetailRecord(HttpServletResponse response) throws Exception {
        EasyExcel2Util.downLoadExcel(response, DetailRecordVO.class, null, "记录");
    }

    @GetMapping("test/batchInsert")
    @ApiOperation(value = "测试批量导入")
    public void testBatchInsert(){
        sysMenuService.batchInsert();
    }

}
